package com.jwsoft.manager.core.gateway.controller;

import com.jwsoft.manager.common.vo.eduDyjyQuerySync.EduDyjyQuerySyncVO;
import com.jwsoft.manager.common.vo.eduStudentEnroll.EduStudentEnrollVO;
import com.jwsoft.manager.common.vo.eduSyncDyApply.EduSyncDyCommonVO;
import com.jwsoft.manager.core.dao.model.EduSyncDyApply;
import com.jwsoft.manager.core.integration.EduSyncDyApplyIntegration;
import com.jwsoft.manager.common.vo.eduSyncDyApply.EduSyncDyApplyVO;
import com.jwsoft.manager.common.vo.eduSyncDyApply.EduSyncDyApplyKeyVO;
import com.jwsoft.manager.common.vo.eduSyncDyApply.EduSyncDyApplyQueryVO;
import com.github.pagehelper.PageInfo;
import com.bifang.engine.assistant.core.domain.AppResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import com.bifang.engine.protect.core.annotation.Idempotent;
import org.springframework.validation.annotation.Validated;
import com.bifang.assistant.common.constants.Validators;

/**
 * 东阳市报名专库同步情况表网关
 *
 * @author wangt
 * @since 2024-06-11
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "东阳市报名专库同步情况表", description = "东阳市报名专库同步情况表")
public class EduSyncDyApplyController {

    @Autowired
    public EduSyncDyApplyIntegration eduSyncDyApplyIntegration;

    @Operation(summary = "东阳市报名专库同步情况表分页查询",description = "东阳市报名专库同步情况表分页查询")
    @PostMapping(value = "/eduSyncDyApply0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduSyncDyApplyVO>> getList(@RequestBody @Validated EduSyncDyApplyQueryVO vo) {
        return AppResponse.successData(eduSyncDyApplyIntegration.getList(vo));
    }

    @Operation(summary = "东阳市报名专库同步情况表根据主键查询详情",description = "东阳市报名专库同步情况表根据主键查询详情")
    @PostMapping(value = "/eduSyncDyApply0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSyncDyApplyVO> getById(@RequestBody @Validated EduSyncDyApplyKeyVO vo) {
        return AppResponse.successData(eduSyncDyApplyIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "东阳市报名专库同步情况表新增",description = "东阳市报名专库同步情况表新增")
    @PostMapping(value = "/eduSyncDyApply0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSyncDyApplyVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduSyncDyApplyVO vo) {
        return AppResponse.successData(eduSyncDyApplyIntegration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "东阳市报名专库同步情况表修改",description = "东阳市报名专库同步情况表修改")
    @PostMapping(value = "/eduSyncDyApply0005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSyncDyApplyVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduSyncDyApplyVO vo) {
        return AppResponse.successData(eduSyncDyApplyIntegration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "东阳市报名专库同步情况表删除",description = "东阳市报名专库同步情况表删除")
    @PostMapping(value = "/eduSyncDyApply0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduSyncDyApplyKeyVO vo) {
        eduSyncDyApplyIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }

    @Operation(summary = "输入身份证查询报名信息",description = "输入身份证查询信息")
    @PostMapping(value = "/eduSyncDyApply0007", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSyncDyCommonVO> getListByIdCard(@RequestBody @Validated EduSyncDyApplyQueryVO vo) {
        return AppResponse.successData(eduSyncDyApplyIntegration.getListByIdCard(vo));
    }

    @Operation(summary = "批量生成报名数据",description = "批量生成报名数据")
    @PostMapping(value = "/eduSyncDyApply0008", produces = "application/json;charset=UTF-8")
    public AppResponse addBatch(@RequestBody @Validated EduSyncDyApplyQueryVO vo) {
        eduSyncDyApplyIntegration.addBatch(vo);
        return AppResponse.successMsg("操作成功！");
    }


    @Operation(summary = "报名同步学生信息保存",description = "报名同步学生信息保存")
    @PostMapping(value = "/eduSyncDyApply0009", produces = "application/json;charset=UTF-8")
    public AppResponse<EduSyncDyApply> saveBm(@RequestBody @Validated EduStudentEnrollVO vo)  {
        return AppResponse.successData(eduSyncDyApplyIntegration.saveBm(vo));
    }

}
